package com.dhh.sky;

import android.app.Application;
import com.microsoft.live.LiveAuthClient;
import com.microsoft.live.LiveConnectClient;
import com.microsoft.live.LiveConnectSession;
import com.microsoft.live.LiveDownloadOperation;
import com.microsoft.live.LiveOperation;

public class SDAApplication extends Application{
	private LiveAuthClient mAuthClient;
	private LiveConnectClient mConnectClient;
	private LiveConnectSession mSession;
	private LiveOperation uploadOperation;
	private LiveDownloadOperation downloadloadOperation;

    public LiveDownloadOperation getDownloadloadOperation() {
		return downloadloadOperation;
	}

	public void setDownloadloadOperation(LiveDownloadOperation downloadloadOperation) {
		this.downloadloadOperation = downloadloadOperation;
	}
	
	public void stopDownloading(){
		if(downloadloadOperation!=null){
			downloadloadOperation.cancel();
		}
	}

	public LiveOperation getUploadOperation() {
		return uploadOperation;
	}

	public void setUploadOperation(LiveOperation uploadOperation) {
		this.uploadOperation = uploadOperation;
	}
	
	public void stopUploading(){
		if(uploadOperation!=null){
			uploadOperation.cancel();
		}
	}

	public LiveAuthClient getAuthClient() {
        return mAuthClient;
    }

    public LiveConnectClient getConnectClient() {
        return mConnectClient;
    }

    public LiveConnectSession getSession() {
        return mSession;
    }

    public void setAuthClient(LiveAuthClient authClient) {
        mAuthClient = authClient;
    }

    public void setConnectClient(LiveConnectClient connectClient) {
        mConnectClient = connectClient;
    }

    public void setSession(LiveConnectSession session) {
        mSession = session;
    }
    
    public void initConnection(LiveAuthClient authClient,LiveConnectSession session,LiveConnectClient connectClient){
    	mAuthClient = authClient;
    	mSession = session;
    	mConnectClient = connectClient;
    }
    
    public boolean isConnected(){
    	boolean flag = false;
    	if(mSession!=null && mConnectClient!=null){
    		flag = true;
    	}
    	
    	return flag;
    }
}
